package cc.magicjson.mall.member.interfaces.rest;

import cc.magicjson.mall.member.application.command.RegisterMemberCommand;
import cc.magicjson.mall.member.application.service.MemberApplicationService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/members")
public class MemberController {
	private final MemberApplicationService memberApplicationService;

	public MemberController(MemberApplicationService memberApplicationService) {
		this.memberApplicationService = memberApplicationService;
	}

	@PostMapping
	public ResponseEntity<String> registerMember(@RequestBody RegisterMemberCommand command) {
		return ResponseEntity.ok(memberApplicationService.registerMember(command));
	}

	//TODO 其他控制器方法...
}